#include <stdio.h>

int is( int number );
void count_sum( int a, int b );

int main()
{
    int a, b;

    scanf("%d %d", &a, &b);
    if (is(a)) printf("%d is counted.\n", a);
    if (is(b)) printf("%d is counted.\n", b);
    count_sum(a, b);

    return 0;
}
int is( int number ) { 
    int p, m, n = 0, i;

    while (number != 0) {
        p = number % 10;        // 余值
        number = number / 10;   // 去掉末尾
        n += p;
    }
    return n == 5; 
}
void count_sum( int a, int b ) {
    int i, count = 0, sum = 0;
    for (i = a; i <= b; i++) {
        if (is(i) == 1) {
            count++;
            sum = sum + i;
        }
    }
    printf("count = %d, sum = %d", count, sum);
}